package com.it.sun.esaychat.chat.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.util.List;

import com.it.sun.easychat.common.jdbctypehandler.ListTypeHandler;
import com.it.sun.easychat.model.vo.UserVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author sunmannian
 * @since 2020-05-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("e_chat_base_chat_room")
@ApiModel(value = "ChatRoomEntity对象", description = "")
public class ChatRoomEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value="id_",type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "群聊名称")
    @TableField("name_")
    private String name;

    @TableField(value = "members",typeHandler = ListTypeHandler.class)
    @ApiModelProperty("聊天室成员")
    private List<UserVO> members;

    @TableField(value = "delete_", fill = FieldFill.INSERT)
    @TableLogic
    private Integer delete;

    @ApiModelProperty(value = "群聊创建人")
    @TableField("create_id_")
    private String createId;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time_", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time_", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}
